import request from "@/utils/request";

export const getDepartmentList = (params?: any) => {
  return request({
    url: "/department/list",
    method: "get",
    params,
  });
};

export const getDepartmentForm = (id: number) => {
  return request({
    url: "/department/" + id,
    method: "get",
  });
};

export const addDepartment = (data: any) => {
  return request({
    url: "/department/add",
    method: "post",
    data,
  });
};

export const editDepartment = (data: any) => {
  return request({
    url: "/department/edit",
    method: "put",
    data,
  });
};

export const deleteDepartment = (id: number) => {
  return request({
    url: "/department/delete/" + id,
    method: "delete",
  });
};

export const getDepartmentOptionsApi = () => {
  return request({
    url: "/department/options",
    method: "get",
  });
};
